<?php
if($form_rec->is_valid($_POST)){
    
    $headers = "Reply-To : contact@tousartistes.fr\n";
    $headers = "From: tousarbitres<contact@tousartistes.fr>\n";
    
    //$headers .= "Content-type: text/html; charset=ISO-8859-1\n";
    $headers .= "Content-Type: text/html; charset=\"iso-8859-1\"";
    $body="<font color='#000000;' face='Century Gothic, Gill sans MT,Verdana' size='2'>";
    
    $body.=$_SESSION['prenom'].' '.$_SESSION['nom'] ."vous recommande.<br>";
    $body.="<a href='http://tousarbitres.fr'>";
    $body.="http://tousarbitres.fr/";
    $body.="</a>";
    $body.="<br><br>";
    $body.="</font>";
    $obj=" tousarbitres";
    
        
        for($i=1;$i<=3;$i++){
            if(!empty($_POST['mail'.$i])){
            
                $mail = $_POST['mail'.$i];       
                mail($mail,$obj,$body,$headers); 
            }
        }
        
        ?>   
        <script type='text/javascript'>
          window.location="?page_id=3107";
        </script>                                         
       <?php 
        
        
        
}      
?>
    